package com.bokee.archerwq.lab.twhomework;

/**
 * Plateau, rectangular abstraction.
 * 
 * @author Johnny 2012-8-1
 * 
 */
public class Plateau {

	private int lower = 0;
	private int left = 0;
	private int upper;
	private int right;

	public Plateau(int upper, int right) {
		this.upper = upper;
		this.right = right;
	}

	/**
	 * Check the coordinate within the rectangular or not.
	 * 
	 * @param coordinateX
	 * @param coordinateY
	 * @return true if the coordinate within the rectangular, otherwise false
	 */
	public boolean validate(int coordinateX, int coordinateY) {
		return coordinateX >= left && coordinateX <= right
				&& coordinateY >= lower && coordinateY <= upper;
	}

}
